/* 
 * Funciones de del configuracion para el
 * control de Tipos de Bono.
 */

/*  Eventos */
$('#agregarArea').click(agregarArea);
$('#consultarArea').click(consultarArea);
$('#modificarArea').click(modificarArea);

/* Funciones */
function agregarArea(){

    $('.current_option').removeClass('current_option');
    $('#agregarArea').addClass('current_option');
    $('#center').load('ModuloConfiguracion/agregarArea.jsp');
    return false;
}

function consultarArea(){
    $('.current_option').removeClass('current_option');
    $('#consultarArea').addClass('current_option');
    $('#center').load('ModuloConfiguracion/consultarAreas.jsp');
    return false;
}

function modificarArea(id_area){
    $.ajax({
        url: "ModifArea.do",
        data: "id_area="+id_area,
        type: "post",
        success: function(answer){
            $('#center').html(answer);
        }
    });
    return false;
}

function actualizarArea(){
    $.ajax({
        url: "ModifArea.do",
        data: $('#ModifAreaForm').serialize(),
        success: function(answer){
            $('#center').html(answer);
        }
    });
    return false;
}


function desactivarArea(idArea){
    $.ajax({
        url: "DirectEliminateArea.do",
        data: "idArea="+idArea,
        type: "post",
        success: function(answer){
            $('#center').html(answer);
        }
    });
    return false;
}

function activarArea(idArea){
    $.ajax({
        url: "activarArea.do",
        data: "idArea="+idArea,
        type: "post",
        success: function(answer){
            $('#center').html(answer);
        }
    });
    return false;
}